package domain;

import java.util.LinkedList;
import java.util.List;

import domain.extra.Result;
import domain.utils.CollectionUtils;

public class DirectBet extends Bet{
	private int number; 
	public static final String NUMBER = "number";

	public DirectBet() {
	}
	
	public DirectBet (int number , int mount){
		this.number = number;
		this.count = mount;
	}
	
	public int getNumber() {
		return number;
	}
	
	public void setNumber(int number) {
		this.number = number;
	}

	@Override
	public int gain() {
		return (this.getCount()*36);
	}

	@Override
	public boolean win(Result r) {
		return this.number== r.getNumber();
	}	
	
	@Override
		public String toString() {
			return this.getPlayer().getName()+"("+this.count+")";
		}

	@Override
	public List getOptions() {
		List list = CollectionUtils.createFromTo(1, 36);
		return  list ;
	}
	
	@Override
	public String getDescription() {
		return "DirectBet";
	}

	@Override
	public void typeOption(Object type) {
		int nroEquivalente = (Integer) type;
		this.setNumber(nroEquivalente);
	}
}
